package com.boot.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;

/**
 * @author
 * @date 2025-07-29
 * @Description
 */
@Controller
public class UserController {
    Logger log = LoggerFactory.getLogger(UserController.class);
    public void test(){
        log.debug("debug ...");
        log.info("info...");
        log.warn("warn....");
        log.error("error...");

        //未来都是从浏览器传递过来了。编码时不知道变量值，所以需要日志打印出来
        String uname = "dmc" ;
        String pass = "123" ;

        log.info("uname="+uname+",pass="+pass);
        log.info("uname={} | pass={}",uname,pass);

        Thread t = new Thread(()->{
            log.info("thread info....");
        });
        t.setName("dmc-thread"); // 设置线程名称
        t.start();
    }
}
